package org.framework.core.orm;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.RowMapper;

public abstract interface IMapper {
	
	/**
	 * entity execute methods
	 * @return 
	 */
	public abstract void save(Object paramObject);
	
	public abstract void save(Object... paramObject);
	
	public abstract void save(Collection<?> paramCollectionOfObject);
	
	public abstract void update(Object paramObject);
	
	public abstract void update(Object... paramObject);
	
	public abstract void update(Collection<?> paramCollectionOfObject);
	
	public abstract void saveOrUpdate(Object paramObject);
	
	public abstract void saveOrUpdate(Object... paramObject);
	
	public abstract void saveOrUpdate(Collection<?> paramCollectionOfObject);

	public abstract void remove(Object paramObject);
	
	public abstract void remove(Object... paramObject);
	
	public abstract void remove(Collection<?> paramCollectionOfObject);
	
	/**
	 * query single methods
	 */
	public abstract Object queryUnique(String paramString, Object[] paramArrayOfObject);
	
	public abstract <T> T get(Class<T> paramClass, Serializable paramSerializable);
	
	public abstract <T> T load(Class<T> paramClass, Serializable paramSerializable);
	
	/**
	 * query limit List<?> methods
	 */
	public abstract <T> List<T> query(String paramString, Class<T> paramClass, Object[] paramArrayOfObject, Integer paramInt1, Integer paramInt2);
	
	public abstract <T> List<T> query(String paramString, RowMapper<T> rowMapper, Object[] paramArrayOfObject);
	
	public abstract List<Object[]> query(String paramString, Object[] paramArrayOfObject, Integer paramInt1, Integer paramInt2);
	
	public abstract List<Map<String, Object>> queryForList(String paramString, Object[] paramArrayOfObject);

	/**
	 * query all List<?> methods
	 */
	public abstract <T> List<T> loadAll(Class<T> paramClass);
	
	/**
	 * execute methods
	 */
	public abstract int execute(String paramString, Object[] paramArrayOfObject);
	
	public abstract int count(String paramString, Object[] paramArrayOfObject);
}
